POV-Ray : Newsgroups : povray.binaries.images : Lightning WIP : Re: Lightning WIP Server Time
18 Aug 2024 12:18:45 EDT (-0400)
  Re: Lightning WIP  
From: Nekar Xenos
Date: 30 Apr 2001 06:02:42
Message: <3aed3842@news.povray.org>
We're off today at work but I came in just to upload my modifications and
now it seems the stiffy I put it on is messed up. Will bring it in tomorrow.
I first tried making branches at random intervals, but I couldn't get it to
be infrequently enough. I've just thought of something - maybe if I tried
#declare ChanceToBranch = 0.01
#if  (ChanceToBranch > rand(md))
       lighningbranch...
I think this is basically the same as your example below except I haven't
tried a macro yet.

At the moment I've got it to make three branches but I'd like to be able to
specify x amount of branches and y amount of sub-branches for instance.
Something like a modified tree macro.I first tried making branches at random
intervals, but I couldn't get it to be infrequently enough. I've just
thought of something - maybe if I tried
#declare ChanceToBranch = 0.01
#if  (ChanceToBranch > rand(md))
       lighningbranch...


> Make it recursive.
>
> #macro lightning(......)
>  ................
>  #if (ChanceToBranch < rand(rnd))
>     lightning(.......)
>  #end
> #end
>
> ChanceToBranch should decrease each time
> it recurses so that the macro will finish at some time.
>

Thanks. I'm not sure what that 'md' is you've got in the rand statement, can
you explain a little more - unless md is the seed of course.


> I've got some lightning code that I never finished. If you like
> I'll post it.

That would be wonderfull - thank you.

Nekar


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.